<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./vue.global.js"></script>
</head>
<body>
    <div id="app">
        <my-head>
            <!--1：多个template分发 v-slot命名
                简写v-slot:title  -》 #title -->
            <template #title>
<!--            <template v-slot:title>-->
                <h2>logo , {{message}}</h2>
            </template>
            <template #list>
<!--            <template v-slot:list>-->
                <ul>
                    <li>首页</li>
                    <li>视频</li>
                    <li>音乐</li>
                </ul>
            </template>
        </my-head>
    </div>
    <script>
        let app = Vue.createApp({
            //message作用域为根组件
            data(){
                return {
                    message: 'hello world'
                }
            }
        })

        app.component(
            'MyHead',
            {
                data(){
                    return {
                    }
                },
                //2：slot name="title" 替换
                template: `
                <header>
                    <slot name="title"></slot>
                    <slot name="list"></slot>
                </header>
                `,

            })

        let vm = app.mount('#app');
    </script>

</body>
</html>